﻿@model mtm.RssParser.Models.RssparserModel
@{ 
    /* Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich 
       To learn more about mytrip.mvc visit  
       http://mytripmvc.net  http://mytripmvc.codeplex.com 
       mytripmvc@gmail.com
       license: Microsoft Public License (Ms-PL) */ 
}
@{
    ViewBag.Title = Html.MytripPageTitle(Model.Title, "/");
    ViewBag.Keywords=Html.MytripPageTitle(Model.Title, ",");
    ViewBag.Description=Html.MytripPageTitle(Model.Title, ",");
}
@section scriptlink{
@Html.ScriptLink("MicrosoftAjax.js,MicrosoftMvcAjax.js")
}
@section contentSmall{
@Html.Partial("_sideBar") 
}
@section contentBig{
<h1 class="title">@Model.Title</h1>
@Html.MytripPager(10,Model.total,"...")
<div class="last"></div>
@if (Model.category){
foreach (var item in Model.RssparserCategory){ 
<div class="content">
@Html.MytripImageForAbstract(item.ImageUrl,60) 
<h3 class="title">
@Html.MytripActionLink(Url.Action("Index", new {id=1,id2=10, id3 = item.RssparserId, id4 = item.Path }), item.Title)</h3>
</div><div class="last"></div>
} 
}else{  
foreach (var item in Model.RssparserContent){ 
<div class="content">
@{string desc = item.Element("description").Value;
string url = item.Element("link").Value;
desc = desc.Replace("href=\"/", ("href=\"" + Model.link + "/"));
if (Model.img){
string urlimg = item.Element("enclosure").Attribute("url").Value;
int imglength = urlimg.Length;
if (urlimg.IndexOf(".jpg") != -1 && urlimg.IndexOf(".jpg") > imglength - 4){
int _imglength = urlimg.IndexOf(".jpg");
urlimg = urlimg.Remove(_imglength + 4);
}else if (urlimg.IndexOf(".png") != -1 && urlimg.IndexOf(".png") > imglength - 4){
int _imglength = urlimg.IndexOf(".png");
urlimg = urlimg.Remove(_imglength + 4);
}else if (urlimg.IndexOf(".gif") != -1 && urlimg.IndexOf(".gif") > imglength - 4){
int _imglength = urlimg.IndexOf(".gif");
urlimg = urlimg.Remove(_imglength + 4);
}
<img src="@urlimg" alt="" style="position: relative; float: right" />
}
}
<h3 class="title"> <a href="@url">@item.Element("title").Value</a></h3>
@Html.Raw(desc)
</div><div class="last"></div>
}
}
@Html.MytripPager(10,Model.total,"...")
}

